<script>
	import { wxLogin } from "@/utils/wxlogin.js"
	import { userinfo } from "@/api/user"
	import { useStore } from "vuex"
	export default {
		onLaunch: function() {
			const store = useStore()
			wxLogin().then(res => {
				wx.setStorageSync('token', res.content.token)
				// token 一个用户的唯一性，token是会随时改变的
				userinfo().then(res => {
					store.commit('app/SET_USER_STATUS', res.content.status)
				})
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
@import "@/style/index.scss";
/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
</style>